home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / pdrd2.zip / RD.ZIP / RD_DEMO2.PRG < prev    next >
Text File  |  1993-01-11  |  1KB  |  42 lines

  1. /*
  2.     RD_DEMO2.PRG
  3.  
  4.     Demonstration of time out feature.  The message "Timed Out!" is displayed
  5.     every 3/18th of a second period of no response from the user.
  6. */
  7.  
  8. #include "read.ch"
  9.  
  10. //---------
  11. func main()
  12. local getlist[0]
  13. local cShort := "Short string"
  14. local cLong := "This is a very long string.  It is '@S PICTUREd'.  This is the last of three sentences."
  15. local nNumber := 9
  16. local lLogical := .t.
  17. local dDate := date()
  18. local aArray := { "Frankie", "Library" }
  19. local nT := 10, nL := 10, nB := 18, nR := 50
  20. local cColor := setcolor( if( iscolor(), "W+/BG, GR+/R,,, N/R", nil ) )
  21. local aScn, aScn2
  22. local bConfig := {|e| ADr_timedout( e, { 3, {||ADmessage( {"Timed Out!"} )} } )}
  23.  
  24. cls
  25. aScn = ADbox( nT, nL, nB, nR )
  26. aScn2 = ADmessage( { "The Read times out every 3 clock ticks of idle period" },;
  27.                    20,, .f., .f. )
  28. @nT+1, nL+2 say "Short String" adget cShort
  29. @nT+2, nL+2 say "Long String " adget cLong picture "@S24"
  30. @nT+3, nL+2 say "Numeric     " adget nNumber
  31. @nT+4, nL+2 say "Logical     " adget lLogical
  32. @nT+5, nL+2 say "Date        " adget dDate
  33. @nT+6, nL+2 say "Array Elem1 " adget aArray[1]
  34. @nT+7, nL+2 say "Array Elem2 " adget aArray[2]
  35. ADread( getlist, bConfig )
  36. ADrestscn( aScn2 )
  37. ADrestscn( aScn )
  38. setcolor( cColor )
  39. return nil
  40.  
  41.  
  42.